<template>
	<view class="content">
		<u-icon name="chat-fill" color="#2979ff" size="50"></u-icon>
		<text>新建项目,完成工程化配置</text>
		<u-search placeholder="日照香炉生紫烟" v-model="keyword"></u-search>
		<u-input prefixIcon="account"  placeholder="请输入用户"  clearable v-model="useracc"/>
		<u-input prefixIcon="lock" type="password" placeholder="请输入密" border="surround" clearable  v-model="password"/>
		<u-button @click="clickLogin" type="primary"  text="登录"></u-button>
	</view>
</template>

<script>
	import { $_toplist } from '@/apis/movie'
	
	export default {
		data() {
			return {
				useracc: '',
				password: '',
				keyword: ''
			}
		},
		onLoad() {

		},
		methods: {
			async clickLogin(){
				//es7:await等待后续promise状态变换,返回结果
				//在函数中使用await关键字,需要把函数修饰为async
				let data = await $_toplist() //只是把这段代码看起来像同步(底层仍然是异步)
				console.log(data)
			}
		}
	}
</script>

<style>
	.content{
		padding: 0 20rpx 0 20rpx;
	}
	/* 1rem = html.font-size   早些年H5做适配 css3的单位
	
	<html> 30
		<div style="width: 10.5rem; height: 10.5rem"></div>
		<image  style="width: 3rem; height: 3rem"/>
	</html>
	
	<script>
		window.screen //获取当前移动设备的宽高
		if(scrern.width >= 1000 && screen.width < 2000)
			document.getElementById('myhtml').style.fontSize = fontsize * 1.5
		else if( 2000  - 3000)
			document.getElementById('myhtml').style.fontSize = fontsize * 2
		else if(500-999)
			document.getElementById('myhtml').style.fontSize = fontsize * 0.7
	</script> */
</style>
